package com.cuit.riskassessment.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cuit.riskassessment.dao.supplier.SupplierMapper;
import com.cuit.riskassessment.service.SupplierService;
import com.cuit.riskassessment.vo.Supplier;
@Service(value = "supplierServiceObject")
public class SupplierServiceImpl implements SupplierService {
	@Autowired
	@Resource(name = "supplierMapper")
	private SupplierMapper mapper;

	@Override
	public int addOrUpdateSupplier(Supplier supplier, boolean flag) {
		if (flag) {
			return mapper.addSupplier(supplier);
		}
		return mapper.updateSupplier(supplier);
	}

	@Override
	public int delSupplier(Integer id) {
		return mapper.delSupplier(id);
	}

	@Override
	public List<Supplier> getAllSuppliers() {
		return mapper.getAllSuppliers();
	}

	@Override
	public List<Supplier> getSupplierByName(String name) {
		return mapper.getSupplierByName(name);
	}

	@Override
	public int setFilePath(Supplier supplier) {
		return mapper.setFilePath(supplier);
	}

	@Override
	public String isHaveFile(Supplier supplier) {
		return mapper.isHaveFile(supplier);
	}

}
